package lx;

import java.util.ArrayList;
import java.util.Collections;
import java.util.stream.Collectors;

public class demo1 {
    public static void main(String[] args) {
        ArrayList<Integer> list = new ArrayList<>();
        Collections.addAll(list, 1, 2, 3, 4, 5, 6, 7, 8, 9,10);
        list.stream()
                .filter(x -> x % 2 == 0)
                .collect(Collectors.toList())
                .forEach(s->System.out.println(s));
    }
}
